#include <stdio.h>

int main()
{
	int i,g,s,b;
	scanf("%d",&i); 
		g =  i%10;
		s = (i/10)%10;
		b = i/100;
		if(i == (g*g*g+s*s*s+b*b*b))
			printf("1");
	    else
		   printf("0");	
	return 0;
}
